package com.yksj.healthtalk.ui.friend;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;

import com.yksj.healthtalk.comm.BaseFragmentActivity;
import com.yksj.healthtalk.ui.R;

/**
 * 虚拟医生和助手资料
 * @author zhao
 *
 */
public class VirtualUserInfoActivity extends BaseFragmentActivity implements OnClickListener {
	//资料类型
	int type = 0;
	String id;//用户id
	
	public void onCreate(Bundle bundle){
		super.onCreate(bundle);
		setContentView(R.layout.virtual_user_info_layout);
		initTitle();
		id = getIntent().getStringExtra("id");
		type = getIntent().getIntExtra("type",-1);
		initUI();
		
	}
	
	public void onStart(){
		super.onStart();
	}
	
	public void onStop(){
		super.onStop();
		
	}
	
	private void initUI(){
		ImageView imageView = (ImageView)findViewById(R.id.user_head);
		titleLeftBtn.setText(getString(R.string.back));
		titleLeftBtn.setOnClickListener(this);
		findViewById(R.id.titlelayout).setBackgroundResource(R.drawable.setting_title_bg);
		TextView numberTextView = (TextView)findViewById(R.id.duomei_number);
		TextView duomeiTextView = (TextView)findViewById(R.id.duomei_number_lable);
		TextView userNameTextView = (TextView)findViewById(R.id.user_name);
		TextView userInfoTextView = (TextView)findViewById(R.id.user_info_item);
		TextView basicTextView  = (TextView)findViewById(R.id.basic_information);
		
		if(type == 1){//助理资料
			titleTextV.setText(getString(R.string.helper_info));
			userInfoTextView.setText(getString(R.string.user_duomei_info));
			userNameTextView.setText(getString(R.string.duomei_helper_name));
			numberTextView.setText(id);
			basicTextView.setText(getString(R.string.duomei_helper_info));
			imageView.setImageDrawable(getResources().getDrawable(R.drawable.duomei_female));
		}else if(type == 2){//医生
			titleTextV.setText(getString(R.string.infoTitle));
			userNameTextView.setText(getString(R.string.duomei_clinic));
			basicTextView.setText(getString(R.string.duomei_clinic_info));
			imageView.setImageDrawable(getResources().getDrawable(R.drawable.doctor_head_female));
			userInfoTextView.setVisibility(View.GONE);
			userInfoTextView.setVisibility(View.GONE);
			numberTextView.setVisibility(View.GONE);
			duomeiTextView.setVisibility(View.GONE);
		}
		
	}

	@Override
	public void onClick(View v) {
		switch(v.getId()){
		case R.id.title_back:
			onBackPressed();
			break;
		}
	}
}
